/*
 * @LastEditTime : 2022-10-27 16:16:22
 * @FilePath     : /pyy/src/http/modules/instandhaltung.js
 * @Description  : api > 设备维修
 */

import axios from "@/utils/axios";

/**
 * 人员唯一标识
 */
const OPEN_ID = localStorage.userId;
// const OPEN_ID = 221122;

export default {
  /**
   * 获取 设备维修-列表数据
   * @param {object} params: 请求参数
   * @param {number} params.page: 分页页码
   * @param {number} params.size: 分页条数
   * @param {string} params.query: 模糊查询数据
   * @return {PromiseLike<{data:{rows:[{ id: null, deviceName: null,consignor: nullrepairSite: null}]}}>}
   */
  getList(params) {
    return axios({
      url: "webjars/equipmentUpkeep/getEquipmentList/" + OPEN_ID,
      method: "POST",
      data: params,
    });
  },

  /**
   * 获取设备维修表单枚举
   * @return {PromiseLike<{data:{"维修方式":[{ id: null, name: null, code: null}]}}>}
   */
  getEnum() {
    return axios({
      url: "webjars/equipmentUpkeep/getEnum",
      method: "GET",
    });
  },

  /**
   * 流程发起
   */
  addInformation(params) {
    return axios({
      url: "webjars/equipmentUpkeep/information/" + OPEN_ID,
      method: "POST",
      data: params,
    });
  },

  /**
   * 获取 设备维修详情
   * @param {string} id: 数据维修数据列表项id
   */
  getDetail(id) {
    return axios({
      url: "webjars/equipmentUpkeep/getEquipmentDetails/" + id,
      method: "GET",
    });
  },
          /**
       * 查看证书详情
       * 
       */
          checkTheCertificateDetails(id) {
            return axios({
              url: "webjars/file/downloadService/"+ id ,
              method: "GET",
        
            });
        },
};
